<script setup lang="ts">
import {useDynamicsStore} from "../store/dynamicsData";

// pinia
const dynamicsStore = useDynamicsStore()

const updateDynamicsSets = () => {
  dynamicsStore.updateDynamicsSets();
};
updateDynamicsSets();
</script>

<template>
  <a-list
      :data-source="dynamicsStore.getDynamicsSets"
      :loading="dynamicsStore.getDynamicsLoading"
      :pagination="dynamicsStore.pagination"
  >
    <template #renderItem="{ item }">
      <a-list-item class="text-lg">
        <router-link :to="{ name: 'IDPage', params: { id: item.id } }" class="text-[#353f60] text-base leading-0">
          {{ item.title }}
        </router-link>
        <template #actions>
          <span>{{ item.time }}</span>
        </template>
      </a-list-item>
    </template>

    <!-- 头部定位 -->
    <template #header>
      <div class="absolute text-[#103588] mt-[-30px] text-lg p-1 border-b border-[#cbcbcb]">
        <strong>最新资讯</strong>
      </div>
    </template>
  </a-list>
</template>

<style scoped>
/* 可以根据需要添加样式 */
</style>
